<!DOCTYPE html>
<html lang="en" xmlns:th="http://thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>AllOrders</title>
    <link href="../css/test.css" rel="stylesheet">
</head>
<div th:replace="common/top"></div>
<!--    <a th:href="@{/order/returntoMain}">回到首页</a>-->

<section class="content">
    <!--    <aside id="sidebar" class="menu">-->
    <!--        <p class="menu-label">-->
    <!--            General-->
    <!--        </p>-->
    <!--        <ul class="menu-list">-->
    <!--            <li><a>Dashboard</a></li>-->
    <!--            <li><a>Customers</a></li>-->
    <!--        </ul>-->
    <!--        <p class="menu-label">-->
    <!--            Administration-->
    <!--        </p>-->
    <!--        <ul class="menu-list">-->
    <!--            <li><a>Team Settings</a></li>-->
    <!--            <li>-->
    <!--                <a class="is-active">Manage Your Team</a>-->
    <!--                <ul>-->
    <!--                    <li><a>Members</a></li>-->
    <!--                    <li><a>Plugins</a></li>-->
    <!--                    <li><a>Add a member</a></li>-->
    <!--                </ul>-->
    <!--            </li>-->
    <!--            <li><a>Invitations</a></li>-->
    <!--            <li><a>Cloud Storage Environment Settings</a></li>-->
    <!--            <li><a>Authentication</a></li>-->
    <!--        </ul>-->
    <!--        <p class="menu-label">-->
    <!--            Transactions-->
    <!--        </p>-->
    <!--        <ul class="menu-list">-->
    <!--            <li><a>Payments</a></li>-->
    <!--            <li><a>Transfers</a></li>-->
    <!--            <li><a>Balance</a></li>-->
    <!--        </ul>-->
    <!--    </aside>-->
    <main>
        <div class="container">
            <h1 class="title">All Orders</h1>
                <table class="table table-bordered table-striped table-hover">

                    <tr>

                        <th>OrderId</th>

                        <th>UserId</th>
                        <th>ShipZip</th>
                        <th>BillZip</th>

                        <th>TotalPrice</th>
                        <th>操作</th>
                        <th>状态</th>
                        <th>发货</th>
                    </tr>
                    <tr th:each="order:${orderList}">
                        <td>
                            <a th:text="${order.orderId}">OrderId</a>
                        </td>
                        <td>
                            <a th:href="@{/order/customerOrder(userId=${order.username})}" th:text="${order.username}">UserId</a>
                        </td>
                        <td>
                            <a th:text="${order.shipZip}">ShipZip</a>
                        </td>
                        <td>
                            <a th:text="${order.billZip}">BillZip</a>
                        </td>
                        <td>
                            <a th:text="${order.totalPrice}">TotalPrice</a>
                        </td>
                        <td>
                            <a th:href="@{/order/toEditOrder(orderId=${order.orderId})}">修改</a>
                            <a th:href="@{/order/deleteOrder(orderId=${order.orderId})}">删除</a>
                        </td>
                        <td>
                            <a th:if="${order.status=='S'}" th:text="已发货">状态</a>
                            <a th:if="${order.status=='P'}" th:text="未发货">状态</a>
                        </td>
                        <td>

                            <a th:href="@{/order/sendOut(orderId=${order.orderId})}">发货</a>
                            <!--<input th:href="@{/order/sendOut(orderId=${order.orderId})}" id="sendOut" type="submit" class="button" name="submit" value="发货">-->
                        </td>

                    </tr>
                </table>

                <a href="/order/show">数据可视化</a>
        </div>
    </main>
</section>
<div th:replace="common/bottom"></div>

</body>
</html>